- /* scistrm.cpp by K.Tsuru */
- // function ID = 903
- /**************************
- SComplex class
- It provides the input.
- **************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- static bool num_part(int c){
- if(isdigit(c)) return true;
- switch(c){
- case ' ':
- case 'e':
- case 'E':
- case '.':
- case '-':
- case '+': return true;
- default:break;
- }
- return false;
- }
- // set SComplex value by (rp,ip).() is not necessary Use delimiter ',' only.
- SComplex SetComplex(const char* s){
- string rp, ip;
- int i = 0, c;
- while( !num_part(s[i]) ) i++;
- while(num_part(c = s[i])){ rp += c; i++;}
- if(c == ',') i++;
- while(num_part(c = s[i])){ ip += c; i++;}
-
- return SComplex(rp.data(),ip.data());
- }
- istream& operator>>(istream& s, SComplex& a) { // added since version 2.21
- string buf;
- std::getline(s, buf);
- a = SetComplex(buf.data());
- return s;
- }
scistrm.cpp : last modifiled at 2015/05/06 16:17:04(891 bytes)
created at 2017/10/06 15:21:28
The creation time of this html file is 2017/10/06 15:27:09 (Fri Oct 06 15:27:09 2017).